<?php
/**
 * | ---------------------------------------------------------------------------------------------------
 * | Author：johnxu <fsyzxz@163.com>.
 * | ---------------------------------------------------------------------------------------------------
 * | Home: https://www.johnxu.net.
 * | ---------------------------------------------------------------------------------------------------
 * | Data: 2019-03-16
 * | ---------------------------------------------------------------------------------------------------
 * | Desc:
 * | ---------------------------------------------------------------------------------------------------
 */

namespace app\admin\model;

use think\Model;

class UsersGroup extends Model
{
    protected $name = 'users_group';

    /**
     * 根据用户ID获取分组ID
     *
     * @param $id
     *
     * @return mixed
     */
    public static function getGroupIdByUsersId( $id )
    {
        return self::where( [ 'users_id' => $id ] )->value( 'group_id' );
    }
}